<template>
  
    <tr>
    <td><input type="checkbox" v-model="item.checked"></td>
    <td>{{ item.name }}</td>
    <td>{{ item.price }}</td>
    <td>
      <button @click="item.num--" :disabled="item.num === 1">-</button>
      {{ item.num }}
      <button @click="item.num++">+</button>
    </td>
    <td>{{ item.price * item.num }}</td>
     <td>
      <button @click="delBtn(index)">删除</button>
     </td>
    </tr>

</template>

<script>
export default {
  props:{
    item:{
      type:Object
    },
    index:{
      type: Number
    },
    
  },
  methods:{
    delBtn(index){
      this.$emit('delFn', index)
    }
  },
  
}
</script>

<style scoped>
  
</style>